﻿using BCEntity.OA.WorkflowTemplate.WorkflowCategory;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BCData.OA.WorkflowTemplate.WorkflowCategory
{
    /// <summary>
    /// 工作流分类
    /// </summary>
    public interface IWorkflowCategoryData
    {

        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="categoryName">工作流分类Id</param>
        Task<bool> Exists(long companyId,string categoryName);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="categoryName">工作流分类Id</param>
        Task<bool> Exists(string categoryName);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="workflowCategoryId">工作流分类Id</param>
        Task<bool> Exists(long workflowCategoryId);
        /// <summary>
        /// 增加一条数据
        /// </summary>
        /// <param name="entity">工作流分类信息</param>
        Task<WorkflowCategoryEntity> Add(WorkflowCategoryEntity entity);
        /// <summary>
        /// 修改一条数据
        /// </summary>
        /// <param name="entity">工作流分类信息</param>
        Task<WorkflowCategoryEntity> Update(WorkflowCategoryEntity entity);
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="workflowCategoryId">工作流分类Id</param>
        Task<bool> Delete(long workflowCategoryId);
        /// <summary>
        /// 获取工作流分类
        /// </summary>
        /// <param name="workflowCategoryId">工作流分类Id</param>
        Task<WorkflowCategoryEntity> GetEntity(long workflowCategoryId);
        /// <summary>
        /// 获取工作流分类
        /// </summary>
        /// <param name="categoryCode">分类Code</param>
        /// <returns></returns>
        Task<WorkflowCategoryEntity> GetEntity(string categoryCode);
        /// <summary>
		/// 获取工作流分类列表
		/// </summary>
        /// <param name="companyId">公司Id</param>
		Task<IEnumerable<WorkflowCategoryEntity>> GetList(int? companyId);
        /// <summary>
		/// 获取工作流分类分页列表
		/// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="categoryName">分类名称</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<WorkflowCategoryEntity>, int)> Query(int? companyId,string categoryName, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }
}
